<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
  <meta name="keywords" content="admin, dashboard, bootstrap, template, flat, modern, theme, responsive, fluid, retina, backend, html5, css, css3">
  <meta name="description" content="">
  <meta name="author" content="ThemeBucket">

  <title>{:lang("菜单列表")}</title>
  
  <!--common-->
  <link href="/static/css/public/style.css" rel="stylesheet">
  <link href="/static/css/public/style-responsive.css" rel="stylesheet">

  <!--dynamic table-->
  <link href="/static/js/public/advanced-datatable/css/demo_page.css" rel="stylesheet" />
  <link href="/static/js/public/advanced-datatable/css/demo_table.css" rel="stylesheet" />
  <link rel="stylesheet" href="/static/js/public/data-tables/DT_bootstrap.css" />


  <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!--[if lt IE 9]>
  <script src="js/html5shiv.js"></script>
  <script src="js/respond.min.js"></script>
  <![endif]-->
</head>

<body class="sticky-header">
	<!-- 左侧菜单开始-->
	{include file="public/nav_left"}
    <!-- 左侧菜单结束-->
    
    <!-- main content start-->
    <div class="main-content" >

        <!-- 头部菜单开始-->
          {include file="public/nav_top"}
        <!-- 头部菜单结束-->
        
        
        <!-- page heading start-->
        <div class="page-heading">
            <h3>
                {:lang("菜单列表")}
            </h3>
        </div>
        <!-- page heading end-->

        <!--主内容开始-->
        <div class="wrapper">
            <div class="row">
        <div class="col-sm-12">
        <section class="panel">
        <header class="panel-heading">
            <span class="tools pull-right">
                <a href="javascript:;" class="fa fa-chevron-down"></a>
                <a href="javascript:;" class="fa fa-times"></a>
             </span>
        </header>
        <div class="panel-body">
        <div class="adv-table">
        <div class="clearfix">
                    <div class="btn-group">
                        <button id="editable-sample_new" class="btn btn-primary" onClick="location='/admin/Menu/addMenuData'">
                            {:lang("新增")} <i class="fa fa-plus"></i>
                        </button>
                    </div>
                    <!--<div class="btn-group pull-right">-->
                        <!--<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">工具 <i class="fa fa-angle-down"></i>-->
                        <!--</button>-->
                        <!--<ul class="dropdown-menu pull-right">-->
                            <!--<li><a href="#">打印</a></li>-->
                            <!--<li><a href="#">保存为PDF</a></li>-->
                            <!--<li><a href="#">保存为Excel</a></li>-->
                        <!--</ul>-->
                    <!--</div>-->
        </div>
        <table  class="display table table-bordered table-striped" id="dynamic-table">
        <thead>
        <tr>
            <th>{:lang("序号")}</th>
            <th>{:lang("菜单名称")}</th>
            <th>{:lang("菜单链接")}</th>
            <th>{:lang("排序")}</th>
            <th>{:lang("操作")}</th>
       
        </tr>
        </thead>
        <tbody>
        
    
        {volist name="list" id="vo"}
         <tr class="gradeA">
            <td>{$vo.id}</td>
            <td>{:lang($vo.menu_name)}</td>
            <td>{$vo.menu_url}</td>     
            <td>{$vo.sort}</td>    
            <td>
              <button class="btn btn-success btn-xs" type="button" onClick="editMenu(this)" >{:lang("编辑")}</button>
              <button class="btn btn-danger btn-xs" type="button" onClick="deleteMenu(this)" >{:lang("删除")}</button>
            </td>
        </tr>
          {/volist}
        </tbody>
        
        <tfoot>
        <tr>
            <th>{:lang("序号")}</th>
            <th>{:lang("菜单名称")}</th>
            <th>{:lang("菜单链接")}</th>
            <th>{:lang("排序")}</th>
            <th>{:lang("操作")}</th>
        </tr>
        </tfoot>
        </table>
        </div>
        </div>
        </section>
        </div>
        </div>
        </div>
        <!--主内容结束-->
    </div>
    <!-- main content end-->

<!-- Placed js at the end of the document so the pages load faster -->
<script src="/static/js/public/jquery-1.10.2.min.js"></script>
<script src="/static/js/public/jquery-ui-1.9.2.custom.min.js"></script>
<script src="/static/js/public/jquery-migrate-1.2.1.min.js"></script>
<script src="/static/js/public/bootstrap.min.js"></script>
<script src="/static/js/public/modernizr.min.js"></script>
<script src="/static/js/public/jquery.nicescroll.js"></script>
<script src="/static/js/public/layer.js"></script>


<!--dynamic table-->
<script src="/static/js/public/advanced-datatable/js/jquery.dataTables.js"></script>
<script src="/static/js/public/data-tables/DT_bootstrap.js"></script>
<!--dynamic table initialization -->
<script src="/static/js/public/dynamic_table_init.js"></script>

<!--common scripts for all pages-->
<script src="/static/js/public/scripts.js"></script>
<script>
//编辑
function editMenu(obj){
    var id =  $(obj).parent().siblings().eq(0).html();
    location.href = '/admin/Menu/editMenuData/id/'+id;
}
//删除
function deleteMenu(obj){
    layer.confirm('确定删除该菜单?', {
        btn: ['确定','取消'] //按钮
    }, function(){
        var id =  $(obj).parent().siblings().eq(0).html();
        $.post("/admin/Menu/deleteMenuData",{id:id},function(data){
            layer.msg(data.msg);
            if (data.status === 1) {
                setTimeout(function(){
                    window.location.reload()
                }, 1500)
            }
        });
    });
}
</script>
</body>
</html>
